import React from 'react';
import { Breadcrumb } from 'antd';
import './index.less';
import { Link } from 'react-router-dom';

class Bread extends React.Component {
  render() {
    var Bread = '';
    Bread = this.props.bread.map((e, i) => {
      if (i > 0) {
        return (
          <Breadcrumb.Item key={i}>
            <Link to={'/' + e[1]}>{e[0]}</Link>
          </Breadcrumb.Item>
        );
      }
    });
    return (
      <Breadcrumb>
        <Breadcrumb.Item>{this.props.bread[0]}</Breadcrumb.Item>
        {Bread}
      </Breadcrumb>
    );
  }
}

export default Bread;
